

<div class="pageContent">
	<form method="post" action="" class="pageForm required-validate">
		<div class="pageFormContent" layoutH="56">
			<p>
				<label>机构编号：</label>
				<input type="text" name="orgCode" value="#(order.orgCode )" size="30" readonly="readonly" />
			</p>
			<p>
				<label>商户编号：</label>
				<input type="text" name="merchCode" value="#(order.merchCode )" size="30" readonly="readonly" />
			</p>
			<p>
				<label>订单编号：</label>
				<input type="text" name="orderNo" value="#(order.orderNo )" size="30" readonly="readonly" />
			</p>
			<p>
				<label>支付类别：</label>
				<input type="text" name="payType" value="#(order.payType )" size="30" readonly="readonly" />
			</p>
			
			#if(order.orderStatus == 'TS' )
			#if(order.amount != order.totalFee)
			<p>
				<label>退款前交易金额：</label>
				<input type="text" name="amount" value="#number(order.totalFee.toDouble() / 100,'##,###,##0.00')" size="30" readonly="readonly" />
			</p>
			#end
			#end
			<p>
				<label>交易金额：</label>
				<input type="text" name="amount" value="#number(order.amount.toDouble() / 100,'##,###,##0.00')" size="30" readonly="readonly" />
			</p>
			<p>
				<label>手续费：</label>
				<input type="text" name="merchFee" value="#(order.merchFee )" size="30" readonly="readonly" />
			</p>
			<p>
				<label>日切日期：</label>
				<input type="text" name="settleDate" value="#(order.settleDate )" size="30" readonly="readonly" />
			</p>
			<p>
				<label>创建时间：</label>
				<input type="text" name="createTime" value="#(order.createTime )" size="30" readonly="readonly" />
			</p>
			<p>
				<label>支付时间：</label>
				<input type="text" name="payTime" value="#(order.payTime )" size="30" readonly="readonly" />
			</p>
			
			<p>
				<label>订单状态：</label>
				#if(order.orderStatus == 'TC' )
					<input type="text" name="orderStatus" value="下单" size="30" readonly="readonly" />
				#end
				#if(order.orderStatus == 'TS' )
					<input type="text" name="orderStatus" value="成功" size="30" readonly="readonly" />
				#end
				#if(order.orderStatus == 'TF' )
					<input type="text" name="orderStatus" value="失败" size="30" readonly="readonly" />
				#end
				#if(order.orderStatus == 'TU' )
					<input type="text" name="orderStatus" value="未知" size="30" readonly="readonly" />
				#end
				#if(order.orderStatus == 'TI' )
					<input type="text" name="orderStatus" value="处理中" size="30" readonly="readonly" />
				#end
				#if(order.orderStatus == 'CX' )
					<input type="text" name="orderStatus" value="已撤消" size="30" readonly="readonly" />
				#end
				#if(order.orderStatus == 'DF' )
					<input type="text" name="orderStatus" value="退款申请" size="30" readonly="readonly" />
				#end
				#if(order.orderStatus == 'RF' )
					<input type="text" name="orderStatus" value="已退款" size="30" readonly="readonly" />
				#end
			</p>
			
			
			<p>
				<label>通知状态：</label>
				<input type="text" name="notifyStatus" value="#(order.notifyStatus )" size="30" readonly="readonly" />
			</p>
			<p>
				<label>是否入虚账：</label>
				<input type="text" name="isInVirtualAccount" value="#(order.isInVirtualAccount )" size="30" readonly="readonly" />
			</p>
			<p>
				<label>通知地址：</label>
				<input type="text" name="notifyUrl" value="#(order.notifyUrl )" size="30" readonly="readonly" />
			</p>
			
		
			#if(isRef > 0)
			<p>
				<a>退款总笔数:#(isRef)</a>
			</p>	
			#for(Reforder:ReforderList)
			<p>
				<a class="icon" href="merch/order/view?id=#(Reforder.id )" target="navTab">退款订单: #(Reforder.orderNo )金额:#number(Reforder.amount.toDouble() / 100,'##,###,##0.00')</a>
			</p>
			#end
			#end
		
			
		</div>
		
		
		
		
		
		
		
		<div class="formBar">
			<ul>
			
			#if(order.orderStatus == 'TS' )		
			<li>
				<div class="button"><div class="buttonContent"><button type="button" onclick="Redfdojs()" >退款操作</button></div></div>
				</li>
			#end
			#if(order.orderStatus == 'DF' )		
			<li>
				<div class="button"><div class="buttonContent"><button type="button" onclick="RedQueryfdojs()" >退款结果查询</button></div></div>
				</li>
			#end
			
			
				<li>
					<div class="button"><div class="buttonContent"><button type="button" class="close">关闭</button></div></div>
				</li>
			</ul>
		</div>
	</form>
	
	
	
	<script type="text/javascript">
		function RedQueryfdojs(){
			//发起退款结果查询操作
	 		var sdata = "orgCode=#(order.orgCode )&merchCode=#(order.merchCode )&orderNo=#(order.orderNo)";
	 		 $.ajax({
 				type: "POST",
 				url: "merch/order/queryRefurd",
 				data: sdata,
 				dataType: "text",
 				success: function(data){
 					alertMsg.info((data));
	 			}
	 		 });
		}
	
	
		function Redfdojs(){
			alertMsg.confirm("确定要退款吗?", {
				 okCall: function(){
				 	//alert('已经确定退款....');
				 	var yuanyin;
				 	yuanyin=prompt("请输入退款原因?"); /*在页面上弹出提示对话框将用户输入的结果赋给变量name*/
				 	if(yuanyin.length<=6){ //输出用户输入的信息
				 		alertMsg.info("退款原因太短,需要大于六个汉字");	
				 	}else{
				 		var amt = prompt("请输入退款金额(元为单位，两位小数点)", "#(order.amount)");
				 		//发起退款操作
				 		var sdata = "orgCode=#(order.orgCode )&merchCode=#(order.merchCode )&channelOrderNo=#(order.channelOrderNo)&orderNo=#(order.orderNo)&yuanyin="+yuanyin
				 		 + "&refund_fee="+amt;
				 		 $.ajax({
             				type: "POST",
             				url: "merch/order/refurd",
             				data: sdata,
             				dataType: "text",
             				success: function(data){
             					alertMsg.info((data));
				 			}
				 		 });
				 	}
				 },
				 cancelCall : function() {}
				});
		}
	</script>
	
	
	
</div>